feat: add offline legacy profile index schema - #253
Conversation
Co-Authored-By: Codex <noreply@openai.com>
🤖 Codex PR Review✅ Merge allowed: blocking findings were cleared by independent Codex arbitration ⚖️ Codex Review Arbitration✅ clear: The prior blocking finding is fixed in the cumulative diff: ℹ️ Other Findings1. 🟡 [MEDIUM] Security in
|
Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8e6002027c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c88a7beae5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if not isinstance(entry, Mapping) or not isinstance(entry["prefixes"], list): | ||
| raise IndexValidationError() | ||
| top_prefixes = entry["prefixes"] | ||
| normalized_top = sorted({_safe_prefix(prefix) for prefix in top_prefixes}) |
There was a problem hiding this comment.
Reject empty profile prefix entries
When a hand-edited/exported index recomputes the digest with prefixes: [] and every backend_prefixes list also empty, this validator accepts a profile entry the builder never emits. In a complete inventory that can make downstream consumers treat a canonical profile such as SOXL as indexed while there are no observed legacy prefixes to migrate or diagnose; fail closed on not normalized_top instead of accepting an empty entry.
Useful? React with 👍 / 👎.
| collisions = data["collisions"] | ||
| inventory = data["inventory"] | ||
| if not isinstance(entries, Mapping) or not isinstance(collisions, list) or not isinstance(inventory, Mapping): | ||
| raise IndexValidationError() |
There was a problem hiding this comment.
Require the advertised backends field
Because this defaults a missing inventory.backends to [backend], an externally supplied index can recompute its digest and pass validation without the backends field that build_index_from_keys emits as part of the schema. Any downstream consumer that trusts index_from_dict to return the v1 shape and reads validated["inventory"]["backends"] will still hit a missing key, so the validator should fail closed when backends is absent instead of synthesizing it only for internal checks.
Useful? React with 👍 / 👎.
Scope
LI0 only: offline schema/validator and synthetic inventory transformation.
Spec:
/Users/lisiyi/Documents/Codex/2026-07-14/ba-2/outputs/soxl_tqqq_legacy_profile_index_redesign_v1_2026-07-14.mdPR-LI-0Commit:
8e6002027cb915cf446dadc07da2b70b75b4414fNon-goals
No PerformanceStore integration, timing codec, caller/orchestrator, capability/persist_mode/ephemeral/exporter/live changes.
Validation
5 focused tests; full 601 passed, 1 skipped; ruff, compileall, diff-check passed.